package com.cqc.flycotablayout01.adapter;

import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.cqc.flycotablayout01.R;
import com.cqc.flycotablayout01.fragment.Frag1;

/**
 * Created by cui on 2017/9/5.
 */

public class MainFragAdapter extends FragmentPagerAdapter {

    String[] titles = {"语文", "数学", "英语", "物理", "化学", "生物"};

    public MainFragAdapter(FragmentManager fm, String[] titles) {
        super(fm);
        this.titles = titles;
    }


    @Override
    public Fragment getItem(int position) {
        return new Frag1();
    }

    @Override
    public int getCount() {
        return titles.length;
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles[position];
    }
}
